<template>
  <view class="wrapForm">
    <view class="bgLine"></view>
    <view class="wrapFormBody pL15 pR15 pT15 myInfoForm">
      <u-form
        :label-width="160"
        :label-style="{ 'font-size': '30rpx' }"
        class="xf-wrap-form"
        ref="dataForm"
        :model="info"
        :error-type="['toast']"
        >
        <u-form-item label="电子发票">
          <view class="flex jst-end" style="color: #386aff"
            >{{ info.invoiceStatusText }}</view
          >
        </u-form-item>
        <u-form-item label="开票公司">
          <view class="flex jst-end">{{ info.sellerName }}</view>
        </u-form-item>
        <u-form-item label="购方名称">
          <view class="flex jst-end">{{ info.purchaserName }}</view>
        </u-form-item>
        <u-form-item label="购方税号">
          <view class="flex jst-end">{{ info.purchaserTaxpayerNumber }}</view>
        </u-form-item>
        <u-form-item label="开票金额">
          <view class="flex jst-end">{{ info.money }}</view>
        </u-form-item>
        <u-form-item label="申请时间">
          <view class="flex jst-end">{{ info.applicationTime }}</view>
        </u-form-item>
      </u-form>
    </view>
  </view>
</template>

<script>
import { findInvoiceBaseInfo } from "@/api/companyInterface/user.js";
export default {
  data() {
    return {
      id: 0,
      info: {
        invoiceStatusText: "",
        purchaserName: "",
        purchaserTaxpayerNumber: "",
        money: "",
        applicationTime: "",
      },
    };
  },
  onLoad(e) {
    this.id = e.id;
    this.getInfo();
  },
  methods: {
    getInfo() {
      findInvoiceBaseInfo({
        invoiceId: this.id,
      }).then((res) => {
        const { result } = res;
        const invoiceStatusMap = {
          '0': "待审核",
          '1': "待开票",
          '2': "已开票",
          '3': "已驳回",
        };
        this.info = {
          ...result.data,
          invoiceStatusText: invoiceStatusMap[result.data.invoiceStatus],
        };
      });
    },
  },
};
</script>
<style lang="scss">
page {
  height: 100%;
  background-color: #f6f6f6;
}
</style>
<style lang="scss" scoped>
.wrapForm {
  min-height: 100%;
  padding-bottom: 200rpx;
  .wrapFormBody {
    margin-top: -30rpx;
    border-radius: 40rpx 40rpx 0 0;
    background: #fff;
  }

  .bgLine {
    background-color: #ebf0ff;
    width: 100%;
    height: 60rpx;
  }
}
</style>
